home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Scope / Scope Disk #152 (199x)(Scope PD)(US)[WB].zip / Scope Disk #152 (199x)(Scope PD)(US)[WB].adf / SnoopDOS / snoopdos.doc < prev    next >
Text File  |  1990-09-24  |  15KB  |  295 lines

  1.  
  2.                 SnoopDos V1.0 -- Monitors AmigaDOS function calls
  3.  
  4.         (C) Copyright Eddy Carroll, September 1990. Freely Distributable.
  5.  
  6.  
  7. INTRODUCTION
  8.  
  9.     Have you ever wondered why a particular program won't seem to run?
  10.     It could be looking for some special files which you've forgotten to
  11.     install in the appropriate place. SnoopDos was designed to let you
  12.     resolve situations like this, though it's probably useful for other
  13.     things too.
  14.  
  15.     For those who don't like long instruction files, simply run SnoopDos
  16.     with no options, then run a few application programs and look at the
  17.     output displayed in SnoopDos's window. Interesting, eh? For those who'd
  18.     like a more detailed explanation, read on...
  19.  
  20.     When you start SnoopDos, it opens a console window. In this window
  21.     appears details of all calls made by any program on the system to the
  22.     CurrentDir(), DeleteFile, Execute(), LoadSeg(), Lock() and Open()
  23.     functions in the AmigaDOS library. The exception (as usual) is any
  24.     program written in BCPL; this includes most of the commands in the C:
  25.     directory.
  26.  
  27.     SnoopDos will tell you about all attempts to load libraries, devices
  28.     and fonts. It will also tell you if a program looks for a specific file
  29.     (for example in S:) or a specific disk volume or directory. This can be
  30.     very useful when you're playing with new software which may require
  31.     certain fonts or other support files.
  32.  
  33.     An unexpected bonus is that since AmigaDOS environment variables are
  34.     stored as files, SnoopDos will tell you the names of any environment
  35.     variables a program tries to read; if you see references to ENV:<name>
  36.     in the SnoopDos window, then a program is trying to access an environment
  37.     variable called <name>.
  38.  
  39.  
  40. USAGE
  41.  
  42.     When you start SnoopDos, it automatically detaches itself from the CLI
  43.     and runs in the background. You can specify a number of options on the
  44.     command line, either at this time or later on by running SnoopDos again.
  45.     Each option can be given in lower case or upper case to respectively
  46.     enable or disable that setting. Alternatively, you can follow the option
  47.     by `1' or `0' which has the same effect. So, `-d' and `-d1' both enable
  48.     the "Monitor DeleteFile()" option, whereas `-d' and `-d0' both disable
  49.     that option. Without further ado, here's an explanation of each setting:
  50.  
  51.     -a  Normally, SnoopDos uses different colours when displaying messages,
  52.         to allow events to be easily distinguished from each other. You can
  53.         force SnoopDos not to use any colour by disabling this option. This
  54.         can be useful if you only have a 2-colour workbench. If SnoopDos is
  55.         sending its output to a file, it turns off this option by default
  56.         (but you can turn it back on again if you like).
  57.  
  58.     -c  When this option is enabled, SnoopDos prints details of all calls
  59.         to the CurrentDir() function. A program calls CurrentDir() when it
  60.         wants to change its current directory to somewhere else. Note that
  61.         no result is displayed for this function, since AmigaDOS does not
  62.         allow for the possibility of it ever failing.
  63.  
  64.     -d  This option allows you to see all calls to the DeleteFile() function,
  65.         which is called whenever a program wants to delete a file. This can
  66.         be useful with unknown programs, to make sure that they don't do
  67.         anything nasty (though in fairness, there are much more effective
  68.         ways for a rogue program to do damage than by deleting a few files).
  69.  
  70.     -f  When enabled, this option causes SnoopDos to print out the full
  71.         path names for files. For example, if a program's current directory
  72.         is SYS:TOOLS and it tries to open a file called FOO, then the
  73.         filename would be displayed as SYS:TOOLS/FOO. Normally, it would
  74.         just be displayed as FOO. Filenames which are so expanded are
  75.         prefixed by a `>' character. Filenames which already included a full
  76.         path specification don't have this prefix. This allows you to
  77.         determine if the calling program specified the full path or not.
  78.  
  79.     -g  This option enables or disables the monitoring of AmigaDOS's
  80.         LoadSeg() function. This is used to read in a binary loadfile and is
  81.         most commonly used for loading in libraries, devices, fonts and
  82.         handlers, and by third-party DOS shells to load in external commands.
  83.  
  84.     -l  This option enables or disables the monitoring of AmigaDOS's Lock()
  85.         function. Programs usually call this function to see if a particular
  86.         file exists, or as a prelude to some more sophisticated operation on
  87.         the file.
  88.  
  89.     -m  This option allows SnoopDos to be activated or deactivated while
  90.         still leaving it running. It is included merely for completeness;
  91.         a much easier way to achieve the same affect is to type CTRL-D or
  92.         CTRL-E in the SnoopDos window.
  93.  
  94.     -o  This option enables or disables the monitoring of AmigaDOS's Open()
  95.         function. Whenever a program wants to open a file for reading or
  96.         writing, it calls this function.
  97.  
  98.     -w  If several tasks try to call a particular DOS function at the same
  99.         time, SnoopDos can only handle them one at a time. Normally, what
  100.         will happen is that the other tasks speed on without waiting for
  101.         SnoopDos and you see a warning message saying that some function
  102.         calls were missed (this doesn't happen very often anyway). When the
  103.         `-w' option is enabled however, SnoopDos will make all the
  104.         different tasks queue up and take their turn.
  105.  
  106.         There is one important consequence of this: if a program tries to
  107.         access a file on a volume not currently mounted (causing AmigaDOS to
  108.         display a "Please insert volume xyzzy" requester), then SnoopDos will
  109.         print out the details about the file requested but not whether the
  110.         request succeeded or not; it can't do this until you respond to the
  111.         requester. In the meantime, other tasks may now be trying to call
  112.         AmigaDOS. For example, if you might try to pop open a new CLI with
  113.         Dmouse or PopCLI, so that you can do an ASSIGN to fake the requested
  114.         volume. All these tasks will have to wait until the original DOS
  115.         call has been completed.
  116.  
  117.         Since this can confuse things (though only for the user), the option
  118.         is disabled by default. You should only need it if you have to be
  119.         absolutely sure of catching every action made by several tasks.
  120.  
  121.     -x  This option enables or disables monitoring of Execute() calls.
  122.         Unlike most other DOS function calls, the return value from the
  123.         Execute() is NOT displayed; this is because when an Execute suceeds,
  124.         the command being executed will most likely making AmigaDOS calls of
  125.         of its own and if SnoopDos was waiting for Execute() to return, it
  126.         would skip printing these out.
  127.  
  128.         Some forms of Execute() will appear to have no associated command
  129.         to execute. This is normal, and occurs when a program redirects
  130.         command input from another file.
  131.  
  132.  
  133.     By default, Snoopdos operates as if you had started it with:
  134.  
  135.         SnoopDos -a1 -c1 -d1 -f0 -g1 -l0 -m1 -o1 -w0 -x1
  136.  
  137.     or for those who prefer to use the other command format:
  138.  
  139.         SnoopDos -a -c -d -F -g -L -m -o -w -x
  140.  
  141.     There are four additional options as well, which cause immediate
  142.     actions to be performed. These are:
  143.  
  144.     -h  Prints out a help screen for SnoopDos. Actually, typing any
  145.         unrecognised garbage after SnoopDos prints the help screen.
  146.  
  147.     -q  Sends a message to the version of SnoopDos currently running telling
  148.         it to remove itself. This is one way to quit SnoopDos, the other
  149.         way being to type CTRL-C in its window.
  150.  
  151.     -r  Prints out a brief report giving all the current settings for
  152.         SnoopDos (eagle-eyed users may spot a striking resemblance between
  153.         this display and the middle section of the help screen :-). Note
  154.         that all other command line options are ignored when you use -r.
  155.  
  156.     -z  Allows you to specify an alternative output file for SnoopDos to
  157.         send messages to. The filename can follow immediately after the -z,
  158.         or you can leave a space if you like.
  159.  
  160.         There are several uses for this function. First of all, you can use
  161.         it to change the location of the SnoopDos window when it opens, by
  162.         specifying a filename like -zCON:0/0/640/60/SnoopDos) (for a very
  163.         short window). You should always make sure the window is at least 77
  164.         columns wide or the output will look pretty messed up.
  165.  
  166.         If you specify -zSER: or -zAUX: then SnoopDos will send output to
  167.         the serial port at the baud rate specified in Preferences. AUX: is
  168.         slightly preferable to SER: since SnoopDos will then recognise the
  169.         CTRL-C, CTRL-D and CTRL-E characters when typed on the remote
  170.         terminal. If you are using a colour ANSI terminal, you may like to
  171.         re-enable colour by specifying `-a' in conjunction with this option.
  172.  
  173.         Finally, you can of course redirect output to a normal AmigaDOS file.
  174.         You would only want to do this if you wanted to keep a permanent
  175.         record of what went on on your system. This could be useful if you
  176.         allow remote access to your Amiga and want a record of what people
  177.         do on your system.
  178.  
  179.  
  180. THE SNOOPDOS WINDOW
  181.  
  182.     The SnoopDos window is divided into a number of columns, as follows:
  183.  
  184.     Process name
  185.         The name of the process (or CLI command) that is executing the
  186.         DOS call in question. If the DOS call is nested (see Res. below)
  187.         then the process name will be prefixed by '> '.
  188.  
  189.     Func
  190.         The function being executed (Open, Lock or Load). Open is printed
  191.         in white, Lock in orange and Load in black, to allow rows to be
  192.         quickly identifed at a glance. (Of course, if you've changed your
  193.         Preferences, the actual colours may be different.) Other values
  194.         which can appear here are Exec (for Execute), CD (for CurrentDir)
  195.         and Del (for DeleteFile).
  196.  
  197.     Filename
  198.         The name of the file being accessed. Remember that when the `-f'
  199.         option is enabled, this will be prefixed by a `>' character if the
  200.         filename displayed was expanded by SnoopDos to include the current
  201.         directory of the calling process.
  202.  
  203.     Mode
  204.         For Open(), this is OLD if an existing file is being opened or NEW
  205.         if a new file is being opened. For Lock(), this is SHAR if the lock
  206.         is a shared lock (i.e. several processes can access the same file) or
  207.         EXCL if it is an exclusive lock (only this process can access the
  208.         file). It remains empty for LoadSeg().
  209.  
  210.     Res.
  211.         The result of the DOS call. This is either `Okay' in white or
  212.         `Fail' in orange. In general, you learn much more from the `Fail'
  213.         entries (i.e. the things the program tried to find but couldn't).
  214.  
  215.         Occasionally, you may see a `>>>>' appearing here. This happens if
  216.         some other program has also patched DOS library in such a way that
  217.         the function currently being called calls another DOS function
  218.         itself. One such program is Rez, which tries to open a program file
  219.         for reading if you LoadSeg() it. In this case, the `>>>>' indicates
  220.         that DOS calls are being nested. The DOS calls which are nested
  221.         will have the associated process name prefixed by `> ' when they
  222.         are displayed. `> (Done)' is displayed when the top level DOS
  223.         function exits, and the exit status is displayed on the same
  224.         line in the Res. column as normal.
  225.  
  226.     You can type several keys into the SnoopDos window. CTRL-C will terminate
  227.     SnoopDos. CTRL-D will disable monitoring temporarily (and print a brief
  228.     message to that effect); CTRL-E enables it again. Pressing Space or any
  229.     other key will pause the output to the window, as in a CLI window. Press
  230.     BackSpace to continue. Note that if you have the `-w' option enabled and
  231.     you pause the output, all functions for which monitoring is enabled will
  232.     cause the calling process to go to sleep until you restart output again.
  233.  
  234.     When SnoopDos wants to quit, it makes sure that nobody else has patched
  235.     the DOS library after it. If something has, SnoopDos will refuse to exit
  236.     immediately. Instead, it will check approximately every 5 seconds to
  237.     see if it is safe to exit and as soon as it can, it will.
  238.  
  239.  
  240. HISTORY
  241.  
  242.     Version 0.9, May 28th 1990.
  243.  
  244.         Initial Beta release. No doubt people will find lots of bugs.
  245.  
  246.     Version 0.91, May 29th 1990.
  247.  
  248.         Silly bug meant Snoopdos couldn't open its console window unless
  249.         Conman was installed. Now fixed.
  250.  
  251.         Improved the way DOS library is patched to make it somewhat more
  252.         robust (it now works properly with UnixDirs).
  253.  
  254.     Version 0.92, May 31st 1990.
  255.  
  256.         Strange bug seemed to manifest itself when Rez was used; the first
  257.         time a resident program was loaded, the display got messed up. Turns
  258.         out that Rez calls Open() from within LoadSeg(). Such nesting of
  259.         DOS calls is now indicated by prefixing the process name printed
  260.         for any nested operations with a '>'. When the nesting is completed,
  261.         '> Done' is displayed.
  262.  
  263.     Version 0.93, June 2nd 1990.
  264.  
  265.         Added -X option to monitor Execute() calls and reworked assembly
  266.         language glue a bit to make it easier to modify in future.
  267.  
  268.     Version 1.00, 9th September 1990.
  269.  
  270.         First public release. After unexpectedly being sent to the US for
  271.         the summer (new job), I finally got around to tidying it up.
  272.         New features include monitoring of DeleteFile() and CurrentDir(),
  273.         support for alternative devices/files (such as the serial port),
  274.         colour now optional, a few other cosmetic changes.
  275.  
  276.  
  277. AUTHOR
  278.  
  279.     Eddy Carroll
  280.  
  281.     Internet:  ecarroll@vax1.tcd.ie
  282.     ADSPnet:   cbmuk!cbmuka!quartz!ecarroll
  283.     Phone:     +353-1-874540
  284.     Snailmail: The Old Rectory, Delgany, Co. Wicklow, Ireland.
  285.  
  286.  
  287. DISTRIBUTION
  288.  
  289.     SnoopDos may be freely distributed as long as no charge is made other
  290.     than to cover time and copying costs. If you want to include SnoopDos
  291.     as part of a commercial package (somehow I doubt it but it never hurts
  292.     to mention :-) then contact the author listed above. Fred Fish is
  293.     specifically given permission to include SnoopDos in his fine disk
  294.     collection.
  295.